home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / tls / tls085.solintel.Z / tls085.solintel / lib / vtcl / tests / label.tcl < prev    next >
Encoding:
Text File  |  1995-07-20  |  2.0 KB  |  73 lines

  1. # CVS $Id: label.tcl,v 1.7 1995/03/28 11:07:40 zibi Exp $
  2. #
  3. # This should be a minimal test of the label widgets
  4. #
  5. # It does some attachment as well as setting of one label and one 
  6. # push button.
  7. #
  8.  
  9. source tools.tcl
  10.  
  11. set ap [VtOpen "foo"]
  12.  
  13. set dlog [VtFormDialog $ap.labels -title "Labels" \
  14.              -okLabel Exit\
  15.              -okCallback QuitCB ]
  16.  
  17.  
  18. set rc [VtRowColumn $dlog.rc -rightSide FORM -leftSide FORM -bottomSide FORM]
  19.  
  20. # Add each label into the rowcolum using various resources
  21. VtPushButton $rc.left   -label "Left Aligned"   -labelLeft
  22. VtPushButton $rc.center -label "Center Aligned" -labelCenter
  23. VtPushButton $rc.right  -label "Right Aligned"  -labelRight
  24.  
  25. # pixmaps to set
  26. if {[file exists /usr/include/X11/bitmaps/woman]} {
  27.     set monoPix /usr/include/X11/bitmaps/woman
  28. } else {
  29.   if { [ catch {set monoPix $env(VTCL_HOME)/tests/friend.px} errorMsg ] != 0 } {
  30.      set monoPix /lib/vtcl/tests/friend.px
  31.     }
  32. }
  33.  
  34. if {[file exists /usr/include/X11/bitmaps/xdt_p_large/Paint.px]} {
  35.     set colorPix /usr/include/X11/bitmaps/xdt_p_large/Paint.px
  36. } else {
  37.   if { [ catch {set colorPix $env(VTCL_HOME)/tests/file.px} errorMsg ] != 0 } {
  38.      set colorPix /lib/vtcl/tests/file.px
  39.     }
  40. }
  41.  
  42. if {[file exists /usr/include/X11/bitmaps/xdt_p_large/Mail.px]} {
  43.     set colorPix2 /usr/include/X11/bitmaps/xdt_p_large/Mail.px
  44. } else {
  45.   if { [ catch {set colorPix2 $env(VTCL_HOME)/tests/dir.px} errorMsg ] != 0 } {
  46.     set colorPix2 /lib/vtcl/tests/dir.px
  47.     }
  48. }
  49.  
  50. # Add a bitmap and let label generate an insensitive pixmap
  51. VtPushButton $rc.pixmap -pixmap $monoPix
  52.  
  53. set insen [VtPushButton $rc.insen -pixmap $monoPix]
  54. VtSetSensitive $insen 0
  55.  
  56. # Add a pixmap and let label generate an insensitive pixmap
  57. VtPushButton $rc.cpixmap -pixmap $colorPix
  58.  
  59. set cinsen [VtPushButton $rc.cinsen -pixmap $colorPix]
  60. VtSetSensitive $cinsen 0
  61.  
  62. # Add a pixmap and  insensitive pixmap make sure that
  63. # the insensitive pixmap overrides the generated default
  64. set i3 [VtPushButton $rc.pixmap2 -pixmap $colorPix \
  65.          -insensitivePixmap $colorPix2]
  66.  
  67. VtSetSensitive $i3 0
  68.  
  69. VtShow $dlog
  70. VtMainLoop
  71.  
  72.  
  73.